<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>简化对象写法</title>
</head>
<body>
<script>
  // ES6 允许在大括号里直接来写入变量和函数，作为对象的属性和方法
  const name='zhangSan'
  let print= function() {
      console.log('I Love You ~')
  }
  const obj={
    name,
    print,
    str(){
      console.log('mother !!')
    }
  }
  console.log(obj)
</script>
</body>
</html>